package com.help10000.rms.mvp.presenter

import com.amir.common.api.CustomObserver
import com.amir.common.beans.UserMsgCatalogsEntity
import com.amir.common.mvp.model.Model
import com.amir.common.mvp.presenter.BasePresenter
import com.amir.common.utils.Constant
import com.amir.common.utils.SPUtils
import com.help10000.rms.mvp.view.MessageCenterView

class UserMessageCenterPresenter(view: MessageCenterView) : BasePresenter<MessageCenterView>(view) {


    /**
     * 获取消息类型
     */
    fun getMessageCatalogs() {
        val CmpyCode = SPUtils.getString(Constant.CmpyCode)
        val AccessToken = SPUtils.getString(Constant.AccessToken)
        val updateNickname = Model.getServer().getMsgCataLog(AccessToken, CmpyCode)
        Model.getObservable(
            updateNickname,
            object : CustomObserver<UserMsgCatalogsEntity>(mvpView) {

                override fun success(t: UserMsgCatalogsEntity) {
                    mvpView?.onDataSuccess(t.data)
                }
            })
    }
}